tree-wide: Switch tabs ⭾ in various files over to spaces ␠
authorColin Walters <walters@verbum.org>
Thu, 11 May 2017 14:59:21 +0000 (10:59 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 11 May 2017 18:17:26 +0000 (18:17 +0000)
As $DEITY intended.

I was reading the `prepare-root.c` code and the indentation damage was
distracting. Squash tabs that have leaked into various places in the code. I
didn't yet touch the `src/libostree` bits as that has higher potential for
conflict.

Closes: #852
Approved by: jlebon

src/ostree/ostree-trivial-httpd.c
src/rofiles-fuse/main.c
src/switchroot/ostree-prepare-root.c
src/switchroot/ostree-remount.c
tests/readdir-rand.c
tests/test-rollsum.c

index d6f0c4d4b9e4a726428fa7fa7b393bcd073a5bd5..176f5ec769bd6752cd3cbde19d243db6e8ce77e1 100644 (file)
@@ -457,10 +457,10 @@ httpd_callback (SoupServer *server, SoupMessage *msg,
 
 static void
 on_dir_changed (GFileMonitor  *mon,
-               GFile *file,
-               GFile *other,
-               GFileMonitorEvent  event,
-               gpointer user_data)
+                GFile *file,
+                GFile *other,
+                GFileMonitorEvent  event,
+                gpointer user_data)
 {
   OtTrivialHttpd *self = user_data;
 
index 3f0832f585a4f541bb5b1dd1543cd81f807747da..12a9d886318679e7a49236f614764362d4ededd0 100644 (file)
@@ -56,12 +56,12 @@ callback_getattr (const char *path, struct stat *st_data)
   if (!*path)
     {
       if (fstat (basefd, st_data) == -1)
-       return -errno;
+        return -errno;
     }
   else
     {
       if (fstatat (basefd, path, st_data, AT_SYMLINK_NOFOLLOW) == -1)
-       return -errno;
+        return -errno;
     }
   return 0;
 }
@@ -85,7 +85,7 @@ callback_readlink (const char *path, char *buf, size_t size)
 
 static int
 callback_readdir (const char *path, void *buf, fuse_fill_dir_t filler,
-                 off_t offset, struct fuse_file_info *fi)
+                  off_t offset, struct fuse_file_info *fi)
 {
   DIR *dp;
   struct dirent *de;
@@ -102,7 +102,7 @@ callback_readdir (const char *path, void *buf, fuse_fill_dir_t filler,
     {
       dfd = openat (basefd, path, O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC | O_NOCTTY);
       if (dfd == -1)
-       return -errno;
+        return -errno;
     }
 
   /* Transfers ownership of fd */
@@ -117,7 +117,7 @@ callback_readdir (const char *path, void *buf, fuse_fill_dir_t filler,
       st.st_ino = de->d_ino;
       st.st_mode = de->d_type << 12;
       if (filler (buf, de->d_name, &st, 0))
-       break;
+        break;
     }
 
   (void) closedir (dp);
@@ -170,7 +170,7 @@ callback_symlink (const char *from, const char *to)
   if (fstatat (basefd, to, &stbuf, AT_SYMLINK_NOFOLLOW) == -1)
     {
       fprintf (stderr, "Failed to find newly created symlink '%s': %s\n",
-              to, g_strerror (errno));
+               to, g_strerror (errno));
       exit (EXIT_FAILURE);
     }
   return 0;
@@ -209,19 +209,19 @@ can_write (const char *path)
   if (fstatat (basefd, path, &stbuf, 0) == -1)
     {
       if (errno == ENOENT)
-       return 0;
+        return 0;
       else
-       return -errno;
+        return -errno;
     }
   if (stbuf_is_regfile_hardlinked (&stbuf))
     return -EROFS;
   return 0;
 }
 
-#define VERIFY_WRITE(path) do { \
-  int r = can_write (path); \
-  if (r != 0) \
-    return r; \
+#define VERIFY_WRITE(path) do {                 \
+    int r = can_write (path);                   \
+    if (r != 0)                                 \
+      return r;                                 \
   } while (0)
 
 static int
@@ -366,7 +366,7 @@ callback_read_buf (const char *path, struct fuse_bufvec **bufp,
 
 static int
 callback_read (const char *path, char *buf, size_t size, off_t offset,
-              struct fuse_file_info *finfo)
+               struct fuse_file_info *finfo)
 {
   int r;
   r = pread (finfo->fh, buf, size, offset);
@@ -390,7 +390,7 @@ callback_write_buf (const char *path, struct fuse_bufvec *buf, off_t offset,
 
 static int
 callback_write (const char *path, const char *buf, size_t size, off_t offset,
-               struct fuse_file_info *finfo)
+                struct fuse_file_info *finfo)
 {
   int r;
   r = pwrite (finfo->fh, buf, size, offset);
@@ -426,7 +426,7 @@ static int
 callback_access (const char *path, int mode)
 {
   path = ENSURE_RELPATH (path);
-  
+
   /* Apparently at least GNU coreutils rm calls `faccessat(W_OK)`
    * before trying to do an unlink.  So...we'll just lie about
    * writable access here.
@@ -438,14 +438,14 @@ callback_access (const char *path, int mode)
 
 static int
 callback_setxattr (const char *path, const char *name, const char *value,
-                  size_t size, int flags)
+                   size_t size, int flags)
 {
   return -ENOTSUP;
 }
 
 static int
 callback_getxattr (const char *path, const char *name, char *value,
-                  size_t size)
+                   size_t size)
 {
   return -ENOTSUP;
 }
@@ -503,8 +503,7 @@ struct fuse_operations callback_oper = {
   .removexattr = callback_removexattr
 };
 
-enum
-{
+enum {
   KEY_HELP,
   KEY_VERSION,
 };
@@ -513,19 +512,19 @@ static void
 usage (const char *progname)
 {
   fprintf (stdout,
-          "usage: %s basepath mountpoint [options]\n"
-          "\n"
-          "   Makes basepath visible at mountpoint such that files are read-only, directories are writable\n"
-          "\n"
-          "general options:\n"
-          "   -o opt,[opt...]     mount options\n"
-          "   -h  --help          print help\n"
-          "\n", progname);
+           "usage: %s basepath mountpoint [options]\n"
+           "\n"
+           "   Makes basepath visible at mountpoint such that files are read-only, directories are writable\n"
+           "\n"
+           "general options:\n"
+           "   -o opt,[opt...]     mount options\n"
+           "   -h  --help          print help\n"
+           "\n", progname);
 }
 
 static int
 rofs_parse_opt (void *data, const char *arg, int key,
-               struct fuse_args *outargs)
+                struct fuse_args *outargs)
 {
   (void) data;
 
@@ -533,19 +532,19 @@ rofs_parse_opt (void *data, const char *arg, int key,
     {
     case FUSE_OPT_KEY_NONOPT:
       if (basefd == -1)
-       {
-         basefd = openat (AT_FDCWD, arg, O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC | O_NOCTTY);
-         if (basefd == -1)
-           {
-             perror ("openat");
-             exit (EXIT_FAILURE);
-           }
-         return 0;
-       }
+        {
+          basefd = openat (AT_FDCWD, arg, O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC | O_NOCTTY);
+          if (basefd == -1)
+            {
+              perror ("openat");
+              exit (EXIT_FAILURE);
+            }
+          return 0;
+        }
       else
-       {
-         return 1;
-       }
+        {
+          return 1;
+        }
     case FUSE_OPT_KEY_OPT:
       return 1;
     case KEY_HELP:
index ce48a91ef3aae69a19a439a42d2ed855649c1f2e..1dac984d238f39af8195e106b4087b76f2140742 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- c-file-style: "gnu" -*-
  * Switch to new root directory and start init.
- * 
+ *
  * Copyright 2011,2012,2013 Colin Walters <walters@verbum.org>
  *
- * Based on code from util-linux/sys-utils/switch_root.c, 
+ * Based on code from util-linux/sys-utils/switch_root.c,
  * Copyright 2002-2009 Red Hat, Inc.  All rights reserved.
  * Authors:
- *     Peter Jones <pjones@redhat.com>
- *     Jeremy Katz <katzj@redhat.com>
+ *  Peter Jones <pjones@redhat.com>
+ *  Jeremy Katz <katzj@redhat.com>
  *
  * Relicensed with permission to LGPLv2+.
  *
@@ -91,15 +91,15 @@ parse_ostree_cmdline (void)
       const char *next = strchr (iter, ' ');
       const char *next_nonspc = next;
       while (next_nonspc && *next_nonspc == ' ')
-       next_nonspc += 1;
+        next_nonspc += 1;
       if (strncmp (iter, "ostree=", strlen ("ostree=")) == 0)
         {
-         const char *start = iter + strlen ("ostree=");
-         if (next)
-           ret = strndup (start, next - start);
-         else
-           ret = strdup (start);
-         break;
+          const char *start = iter + strlen ("ostree=");
+          if (next)
+            ret = strndup (start, next - start);
+          else
+            ret = strdup (start);
+          break;
         }
       iter = next_nonspc;
     }
@@ -115,7 +115,7 @@ static void
 touch_run_ostree (void)
 {
   int fd;
-  
+
   fd = open ("/run/ostree-booted", O_CREAT | O_WRONLY | O_NOCTTY, 0640);
   /* We ignore failures here in case /run isn't mounted...not much we
    * can do about that, but we don't want to fail.
@@ -239,11 +239,11 @@ main(int argc, char *argv[])
        * later boot and `systemd-remount-fs.service`.
        */
       if (path_is_on_readonly_fs ("."))
-       {
-         if (mount (".", ".", NULL, MS_REMOUNT | MS_SILENT, NULL) < 0)
-           err (EXIT_FAILURE, "failed to remount rootfs writable (for overlayfs)");
-       }
-      
+        {
+          if (mount (".", ".", NULL, MS_REMOUNT | MS_SILENT, NULL) < 0)
+            err (EXIT_FAILURE, "failed to remount rootfs writable (for overlayfs)");
+        }
+
       if (mount ("overlay", "usr", "overlay", 0, usr_ovl_options) < 0)
         err (EXIT_FAILURE, "failed to mount /usr overlayfs");
     }
index 589a3867b95e9da9a53ba4296fe18e048f8c6adc..1b5bd05aa00ac810286763ddf53e438c27afd8c0 100644 (file)
@@ -85,13 +85,13 @@ main(int argc, char *argv[])
       if (S_ISLNK (stbuf.st_mode))
         continue;
       if (mount (target, target, NULL, MS_REMOUNT | MS_SILENT, NULL) < 0)
-       {
+        {
           /* Also ignore ENINVAL - if the target isn't a mountpoint
            * already, then assume things are OK.
            */
           if (errno != EINVAL)
             err (EXIT_FAILURE, "failed to remount %s", target);
-       }
+        }
     }
 
   maybe_mount_tmpfs_on_var ();
index afef387c85c6214ba836743a9341423d39f839f3..10bf8677b8b608994d58e367b8268f19faa7ba11 100644 (file)
@@ -83,7 +83,7 @@ readdir (DIR *dirp)
   struct dirent *(*real_readdir)(DIR *dirp) = dlsym (RTLD_NEXT, READDIR);
   struct dirent *ret;
   gboolean cache_another = TRUE;
-  
+
   ensure_initialized ();
 
   /* The core idea here is that each time through the loop, we read a
@@ -101,40 +101,40 @@ readdir (DIR *dirp)
       errno = 0;
       ret = real_readdir (dirp);
       if (ret == NULL && errno != 0)
-       goto out;
+        goto out;
 
       g_mutex_lock (&direntcache_lock);
       de = g_hash_table_lookup (direntcache, dirp);
       if (ret)
-       {
-         if (g_random_boolean ())
-           {
-             struct dirent *copy;
-             if (!de)
-               {
-                 de = dir_entries_new ();
-                 g_hash_table_insert (direntcache, dirp, de);
-               }
-             copy = g_memdup (ret, sizeof (struct dirent));
-             g_ptr_array_add (de->entries, copy);
-           }
-         else
-           {
-             cache_another = FALSE;
-           }
-       }
+        {
+          if (g_random_boolean ())
+            {
+              struct dirent *copy;
+              if (!de)
+                {
+                  de = dir_entries_new ();
+                  g_hash_table_insert (direntcache, dirp, de);
+                }
+              copy = g_memdup (ret, sizeof (struct dirent));
+              g_ptr_array_add (de->entries, copy);
+            }
+          else
+            {
+              cache_another = FALSE;
+            }
+        }
       else
-       {
-         if (de && de->offset < de->entries->len)
-           {
-             ret = de->entries->pdata[de->offset];
-             de->offset++;
-           }
-         cache_another = FALSE;
-       }
+        {
+          if (de && de->offset < de->entries->len)
+            {
+              ret = de->entries->pdata[de->offset];
+              de->offset++;
+            }
+          cache_another = FALSE;
+        }
       g_mutex_unlock (&direntcache_lock);
     }
-  
+
  out:
   return ret;
 }
@@ -145,7 +145,7 @@ closedir (DIR *dirp)
   int (*real_closedir)(DIR *dirp) = dlsym (RTLD_NEXT, "closedir");
 
   ensure_initialized ();
-  
+
   g_mutex_lock (&direntcache_lock);
   g_hash_table_remove (direntcache, dirp);
   g_mutex_unlock (&direntcache_lock);
@@ -170,7 +170,7 @@ seekdir (DIR *dirp, long loc)
 
   ensure_initialized ();
 
-  /* For now, crash if seekdir is called when we have cached entries. 
+  /* For now, crash if seekdir is called when we have cached entries.
    * If some app wants to use this and seekdir() we can implement it.
    */
   assert_no_cached_entries (dirp);
index 37c8bab8af3f7422e7faecf84d34e81512c0bd5b..a6c1bebd4d917430db2b553a5e6608ef6d360b60 100644 (file)
@@ -152,7 +152,7 @@ test_bupsplit_sum(void)
     sum1a = bupsplit_sum(buf, 0, BUP_SELFTEST_SIZE);
     sum1b = bupsplit_sum(buf, 1, BUP_SELFTEST_SIZE);
     sum2a = bupsplit_sum(buf, BUP_SELFTEST_SIZE - BUP_WINDOWSIZE*5/2,
-                       BUP_SELFTEST_SIZE - BUP_WINDOWSIZE);
+                         BUP_SELFTEST_SIZE - BUP_WINDOWSIZE);
     sum2b = bupsplit_sum(buf, 0, BUP_SELFTEST_SIZE - BUP_WINDOWSIZE);
     sum3a = bupsplit_sum(buf, 0, BUP_WINDOWSIZE+3);
     sum3b = bupsplit_sum(buf, 3, BUP_WINDOWSIZE+3);